<script>
	const {appLogin,httpGet,httpPost,msg,ZC} = require("@/utils/common.js")
	export default {
		onLaunch: function() {
			this.silentLogin()
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		globalData:{
			course_teacher_info:{},	
			target_info:{},
		},
		methods:{
			silentLogin(){
				uni.getSetting({
					success:(res)=>{
						if(res.authSetting['scope.userInfo']){
							uni.login({
								success:(res)=>{
									httpPost({
										url:'users/routineLogin',
										data:{
											code:res.code
										},
										fail:()=>{}
									}).then((res)=>{
										this.globalData.user_info = res.result
										this.globalData.user_token = res.result.token
										ZC('user_info',this.globalData.user_info,-1)
										ZC('user_token',this.globalData.user_token,-1)
									})
								}
							})
						}
					}
				})
			}
		}
	}
</script>

<style>
	/*每个页面公共css */
	@import url("./static/iconfont/iconfont.css");
	@import "colorui/main.css";
	@import "colorui/icon.css";
</style>
